package com.atguigu.cloud.config;

import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import org.springframework.cloud.gateway.handler.predicate.AbstractRoutePredicateFactory;
import org.springframework.cloud.gateway.handler.predicate.AfterRoutePredicateFactory;
import org.springframework.cloud.gateway.handler.predicate.GatewayPredicate;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;

import java.time.ZonedDateTime;
import java.util.Collections;
import java.util.List;
import java.util.function.Predicate;

/**
 * ClassName: My02RoutePredicateFactory
 * Package: com.atguigu.cloud.config
 * Description:
 *
 * @Author 加油-ssj
 * @Create 2025/4/2 9:25
 * @Version 1.0
 */
@Component
public class My02RoutePredicateFactory extends AbstractRoutePredicateFactory<My02RoutePredicateFactory.Config> {


    public My02RoutePredicateFactory(){

        super(My02RoutePredicateFactory.Config.class);
    }

    @Override
    public Predicate<ServerWebExchange> apply(Config config) {
        return null;
    }


    public static class Config{
        @Getter
        @Setter
        @NotNull
        private String grade;
    }

    @Override
    public List<String> shortcutFieldOrder() {
        return Collections.singletonList("grade");
    }








}
